package cz.uhk.ppro.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import cz.uhk.ppro.form.StitekForm;

public class StitekValidator implements Validator{

	public boolean supports(Class<?> clazz) {
		return StitekForm.class.isAssignableFrom(clazz);
	}

	public void validate(Object target, Errors errors) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "nazevStitku", "stitekNazev.required");
	}

}
